<template>
  <div class="onez-view" :class="event?'event':''" :data-id="viewid" v-if="type == 'div'"><slot></slot></div>
  <view class="onez-view" :class="event?'event':''" :data-id="viewid" :id="viewid" v-else><slot></slot></view>
</template>

<script>
export default {
  name: 'onez-view',
  data() {
    return {
      type: typeof window !== 'undefined' && window.Vue ? 'div' : 'view'
    };
  },
  props: {
    viewid: {
      type: String,
      default: null
    },
    event:{
      type:Boolean,
      default:false
    }
  },
  methods: {
    click(e) {
      console.log('~~~~~~~~~~',this.viewid,e);
      this.$emit('hit', e);
    }
  }
};
</script>

<style scoped>
.event {
  pointer-events: all !important;
}
</style>
